package com.taobaolite.item;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ItemRepository extends JpaRepository<Item, Long> {

    @Query("from Item i where i.itemId > ?1 and i.itemId < ?2")
    List<Item> findByType(Long fromType, Long toType);

    @Query("from Item i where i.name like %?1%")
    List<Item> searchByName(String item_q);
}